package com.yh.bean;

public class PageBean {
   static int pageNum=3;    //分页数， 每页显示3条
   private int currentPage;   //当前页
   private int startIndex;     //开始索引
   private int totalPage;      //总页数
   private int reords;  //总记录数
public static int getPageNum() {
	return pageNum;
}
public static void setPageNum(int pageNum) {
	PageBean.pageNum = pageNum;
}
public int getCurrentPage() {
	return currentPage;
}
public void setCurrentPage(int currentPage) {
	//计算开始的索引
	this.startIndex=(currentPage-1)*pageNum;
	this.currentPage = currentPage;
}
public int getStartIndex() {
	return startIndex;
}
public void setStartIndex(int startIndex) {
	this.startIndex = startIndex;
}
public int getTotalPage() {
	return totalPage;
}
public void setTotalPage(int totalPage) {
	this.totalPage = totalPage;
}
public int getReords() {
	return reords;
}
public void setReords(int reords) {
	//计算总页数
	if(reords%pageNum==0){
		this.totalPage=reords/pageNum;
	}else{
		this.totalPage=reords/pageNum+1;
	}
	this.reords = reords;
}

}
